function [Xmean,XupperB,XlowerB] = cal_mean_outputs(all_outputs)
%% calculate the mean value and save 
    % 1. hip position
    % shift to zero
%     all_outputs.ave_dataHP_s = all_outputs.ave_dataHP_s-all_outputs.ave_dataHP_s(:,1);
    [Xmean.x_meanHP,XupperB.upperBHP,XlowerB.lowerBHP] = meanValue(all_outputs.ave_dataHP_s);

    % 2. linearized hip position
%     all_outputs.ave_dataHPL_s = all_outputs.ave_dataHPL_s-all_outputs.ave_dataHPL_s(:,1);
    [Xmean.x_meanHPL,XupperB.upperBHPL,XlowerB.lowerBHPL] = meanValue(all_outputs.ave_dataHPL_s);

    % 3. non-stance slope
    [Xmean.x_meanNSL,XupperB.upperBNSL,XlowerB.lowerBNSL] = meanValue(all_outputs.ave_dataNSslope_s);

    % 4. linearized non-stance slope
    [Xmean.x_meanLNS,XupperB.upperBLNS,XlowerB.lowerBLNS] = meanValue(all_outputs.ave_dataNSslopeL_s);
   
    % 5. stance  COM slope
    [Xmean.x_meanSCOM,XupperB.upperBSCOM,XlowerB.lowerBSCOM]= meanValue(all_outputs.ave_dataSCOM_s);
       
    % 6. stance  COM slope
    [Xmean.x_meanSCOML,XupperB.upperBSCOML,XlowerB.lowerBSCOML]= meanValue(all_outputs.ave_dataSCOML_s);
    
    % 7. non-stance COM slope
    [Xmean.x_meanNSCOM,XupperB.upperBNSCOM,XlowerB.lowerBNSCOM]= meanValue(all_outputs.ave_dataNSCOM_s);
    
    % 8. linearized non-stance COM slope
    [Xmean.x_meanNSCOML,XupperB.upperBNSCOML,XlowerB.lowerBNSCOML]= meanValue(all_outputs.ave_dataNSCOML_s);
% % %     % 5. stance torso slope
% % %      [Xmean.x_meanST,XupperB.upperBST,XlowerB.lowerBST]= meanValue(all_outputs.ave_dataST_s);
% % %     
% % %     
% % %     % 6. Linearized stance torso slope
% % %     [Xmean.x_meanLST,XupperB.upperBLST,XlowerB.lowerBLST] = meanValue(all_outputs.ave_dataSTL_s);
% % %         
% % %     
% % %     % 7. non-stance torso slope
% % %     [Xmean.x_meanNST,XupperB.upperBNST,XlowerB.lowerBNST] = meanValue(all_outputs.ave_dataNST_s);
% % %     
% % %     
% % %     % 8. Linearized non-stance torso slope
% % %     [Xmean.x_meanLNST,XupperB.upperBLNST,XlowerB.lowerBLNST]=meanValue(all_outputs.ave_dataNSTL_s);
% % % 
% % %     
% % %         
% % %     % 9. COM
% % %     [Xmean.x_meanCOM,XupperB.upperBCOM,XlowerB.lowerBCOM] = meanValue(all_outputs.ave_dataCOM_s);
% % %     
% % %     
% % %     % 10. Linearized non-stance torso slope
% % %     [Xmean.x_meanLCOM,XupperB.upperBLCOM,XlowerB.lowerBLCOM]=meanValue(all_outputs.ave_dataCOML_s);
end